﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="Modulos.aspx.cs" Inherits="Web.forms.Modulos" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div width="100%">
        <asp:Panel ID="Panel_Modulos" runat="server" BackColor="White" width="100%">
           <table width="624" cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td width="261" class="celdaTitulo">
                        <asp:Label ID="Label1" runat="server" CssClass="titForm">Administración / Módulos</asp:Label>
                    </td>
                    <td width="363" class="celdaTitulo" height="34">
                        <asp:Image ID="Banner" runat="server" ImageUrl="~/IMG/Banner.jpg" />
                    </td>
                </tr>
                </table>
            <asp:Panel ID="Panel2_Modulos" runat="server" BackColor="#E8E8E8" width="100%">
                <table width="100%">
                    <tr>
                        <td align="left">
                            &nbsp;</td>
                        <td align="left">
                            <asp:Label ID="Lbl_Modulo" runat="server" class="lbl" Text="Modulo" 
                                Visible="False"></asp:Label>
                        </td>
                        <td align="left">
                            <asp:TextBox ID="Txt_Modulo" runat="server" Width="192px" Visible="False" 
                                MaxLength="4"></asp:TextBox>
                        </td>
                        <td align="right" rowspan="7" valign="top">
                            <asp:Button ID="Btn_Aprobar" runat="server" CssClass="save"
                                OnClick="Btn_Aprobar_Click" Visible="true" 
                                ToolTip="Graba o Actualiza un Modulo" />
                            <asp:Button ID="btnNuevo" runat="server" CssClass="new" 
                                onclick="btnNuevo_Click" />
                         </td>
                    </tr>
                    <tr>
                        <td align="left">
                            &nbsp;</td>
                        <td align="left">
                        <asp:Label ID="Lbl_Glosa" runat="server" class="lbl" Text="Glosa"></asp:Label>
                        </td>
                        <td align="left">
                            <asp:TextBox ID="Txt_Glosa" runat="server" Width="192px" MaxLength="20"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td align="left">
                            &nbsp;</td>
                        <td align="left">
                        <asp:Label ID="Lbl_URL_Modulo" runat="server" class="lbl" Text="URL Modulo"></asp:Label>
                        </td>
                        <td align="left">
                            <asp:TextBox ID="Txt_URL_Modulo" runat="server" Width="192px" MaxLength="20"></asp:TextBox>
                        </td>
                        <td align="left">
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td align="left">
                            &nbsp;</td>
                        <td align="left">
                        <asp:Label ID="Lbl_Modulo_Padre" runat="server" class="lbl" Text="Modulo Padre"></asp:Label>
                        </td>
                        <td align="left">
                            <asp:DropDownList ID="ddlModuloPadre" runat="server" Width="192px"/>
                        </td>
                        <td align="left">
                            &nbsp;</td>
                    </tr>
                    <tr>
                        <td align="left">
                            &nbsp;</td>
                        <td align="left">
                            <asp:Label ID="Lbl_Posicion" runat="server" class="lbl" Text="Posicion"></asp:Label>
                        </td>
                        <td align="left">
                            <asp:TextBox ID="txtPosicion" runat="server" Width="192px" MaxLength="2" 
                                onkeypress="ValidaSoloNumeros()"></asp:TextBox>
                        </td>
                        <td align="left">
                            &nbsp;</td>
                    </tr>
                    <tr>
                            <td align="left">
                                &nbsp;</td>
                            <td align="left">
                                <asp:Label ID="lblPerfil" runat="server" CssClass="lbl" Text="Perfil" />
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="ddlPerfiles" runat="server" AutoPostBack="true" 
                                    Style="margin-left: 0px" TabIndex="4" Width="192px" />
                            </td>
                            <td align="left">
                                &nbsp;</td>
                        </tr>
                    <tr>
                        <td align="left">
                            &nbsp;</td>
                        <td align="left" colspan="3">
                            &nbsp;
                        </td>
                    </tr>
                </table>
                <div style="Width:100%;overflow:auto; height: 165px;">
                    <asp:GridView ID="GridView_Modulos" runat="server" AutoGenerateColumns="False" 
                        BorderColor="#E0040B" BorderStyle="Ridge" BorderWidth="5px" 
                        EnableModelValidation="True" 
                        OnRowCommand="GridView_Modulos_RowCommand" 
                        onselectedindexchanged="GridView_Modulos_SelectedIndexChanged" 
                        style="margin-top: 0px" Width="100%">
                        <HeaderStyle BackColor="#343434" ForeColor="White" />
                        <AlternatingRowStyle BackColor="silver" />
                        <Columns>
                            <asp:TemplateField FooterText="Modulo" HeaderText="Modulo" Visible="False">
                                <ItemTemplate>
                                    <asp:Label ID="Label8" runat="server" class="lbl" 
                                        Text='<%# Bind("ModuloId") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField FooterText="Glosa" HeaderText="Glosa">
                                <ItemTemplate>
                                    <asp:Label ID="Label9" runat="server" class="lbl" Text='<%# Bind("Glosa") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField FooterText="URL Modulo" HeaderText="URL Modulo">
                                <ItemTemplate>
                                    <asp:Label ID="Label10" runat="server" class="lbl" Text='<%# Bind("URL") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle Wrap="true" />
                            </asp:TemplateField>
                            <asp:TemplateField FooterText="Modulo Padre" HeaderText="Modulo Padre">
                                <ItemTemplate>
                                    <asp:Label ID="Label11" runat="server" class="lbl" 
                                        Text='<%# Bind("ModuloPadre") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField FooterText="Posicion" HeaderText="Posicion">
                                <ItemTemplate>
                                    <asp:Label ID="Label12" runat="server" class="lbl" 
                                        Text='<%# Bind("Posicion") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField FooterText="Perfil" HeaderText="Perfil">
                                <ItemTemplate>
                                    <asp:Label ID="Label13" runat="server" class="lbl" 
                                        Text='<%# Bind("PERFIL") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField FooterText="Edicion" HeaderText="Accion">
                                <ItemTemplate>
                                    <asp:ImageButton ID="Btn_Edit" runat="server" AlternateText="Editar" 
                                        CommandName="Select" ImageUrl="~/img/edit.gif" />
                                     <asp:ImageButton ID="Btn_Delete" runat="server" AlternateText="Eliminar" 
                                                CommandArgument='<%# Bind("ModuloId") %>' CommandName="Eliminar" 
                                                ImageUrl="~/img/delete.gif" />
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>

                </div> 
            </asp:Panel>
        </asp:Panel>
    </div>
</asp:Content>

